package GaoYuXuan.Homework0715;

/**
 * @author 盖
 * @version 1.0
 * @since 2022-07-15 18:34:14
 */
public class Palindrome {
    public static void main(String[] args) {
        for (int i = 1; i <= 9; i++){
            for (int j = 0; j <= 9; j++){
                for (int m = 0; m <= 9; m++){
                    for (int n = 0; n <= 9; n++){
                        if(i + j + m + n == 12 && (i == n && j == m)){
                            System.out.println("四位的二进制数有：");
                            System.out.println((Integer.toString(i) + Integer.toString(j) + Integer.toString(m) + Integer.toString(n)));
                        }
                    }
                }
            }
        }
        for (int i = 1; i <= 9; i++){
            for (int j = 0; j <= 9; j++){
                for (int m = 0; m <= 9; m++){
                    for (int n = 0; n <= 9; n++){
                        for (int q = 0; q <= 9; q++) {
                            if (i + j + m + n + q == 12 && (i == n && j == m)) {
                                System.out.println("五位的二进制数有：");
                                System.out.println((Integer.toString(i) + Integer.toString(j) + Integer.toString(q) + Integer.toString(m) + Integer.toString(n)));
                            }
                        }
                    }
                }
            }
        }
        for (int i = 1; i <= 9; i++){
            for (int j = 0; j <= 9; j++){
                for (int m = 0; m <= 9; m++){
                    for (int n = 0; n <= 9; n++){
                        for (int q = 0; q <= 9; q++) {
                            for (int w = 0; w <= 9; w++) {
                                if (i + j + m + n + q + w == 12 && (i == n && j == m && q == w)) {
                                    System.out.println("六位的二进制数有：");
                                    System.out.println((Integer.toString(i) + Integer.toString(j) + Integer.toString(q) + Integer.toString(w) + Integer.toString(m) + Integer.toString(n)));
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}